/**
 * 开发任务相关类型定义
 */

import { MISSION_TYPE_NAMES, MISSION_PRIORITY_NAMES, MISSION_STATUS_NAMES } from '@/constants';

// 重新导出名称映射
export const MissionTypeNames = MISSION_TYPE_NAMES;
export const MissionPriorityNames = MISSION_PRIORITY_NAMES;
export const MissionStatusNames = MISSION_STATUS_NAMES;

// 任务类型枚举定义
export interface MissionTypeEnum {
  code: number;
  name: string;
}

// 优先级枚举定义
export interface MissionPriorityEnum {
  code: number;
  name: string;
}

// 状态枚举定义
export interface MissionStatusEnum {
  code: number;
  name: string;
}

// 基础查询参数
export interface BasePageQuery {
  pageNum?: number;
  pageSize?: number;
}

// 开发任务分页查询对象
export interface MissionPageQuery extends BasePageQuery {
  missionTitle?: string;
  missionType?: number;
  priority?: number;
  status?: number;
  createBy?: string;
}

// 基础VO
export interface BaseVO {
  id?: number;
  createBy?: string;
  createTime?: string;
  updateBy?: string;
  updateTime?: string;
  remark?: string;
}

// 开发任务表视图对象
export interface MissionVO extends BaseVO {
  id?: number;
  missionTitle?: string;
  missionDescription?: string;
  missionType?: number;
  missionTypeEnum?: MissionTypeEnum;
  priority?: number;
  missionPriorityEnum?: MissionPriorityEnum;
  status?: number;
  missionStatusEnum?: MissionStatusEnum;
  progress?: number;
  version?: string;
  requirements?: string;
  remarks?: string;
  createByName?: string;
}

// 开发任务表单对象（用于新增/修改）
export interface MissionFormType {
  id?: number;
  missionTitle: string;
  missionDescription?: string;
  missionType: number;
  priority: number;
  status: number;
  progress?: number;
  version?: string;
  requirements?: string;
  remarks?: string;
}

// 分页结果
export interface PageResult<T> {
  list: T[];
  total: number;
  pageNum: number;
  pageSize: number;
}

// API响应结果
export interface Result<T = any> {
  code: number;
  data: T;
  msg: string;
  success: boolean;
}

// 导出VO
export interface MissionExportVO {
  missionTitle?: string;
  missionDescription?: string;
  missionType?: number;
  priority?: number;
  status?: number;
  progress?: number;
  version?: string;
  requirements?: string;
  remarks?: string;
  createByName?: string;
  createTime?: string;
}

// 任务状态更新参数
export interface MissionStatusUpdateParam {
  id: number;
  status: number;
}

// 任务进度更新参数
export interface MissionProgressUpdateParam {
  id: number;
  progress: number;
}
